#include "MelodyTournament.h"
#include "MelodyCrossover.h"

MelodyTournament::MelodyTournament(float selectionProb, float mutationRate,Crossover* crossover)
    : Tournament(selectionProb,mutationRate,crossover)
{
    delete this->evolve;
    this->evolve = crossover;
}

Candidate* MelodyTournament::mutate(Candidate* candidate) {
    if(RandomNumberGenerator::nextFloat(1) < this->mutationRate) {
        for(int i = 0; i <= this->mutationAmount; i++) {
            //candidate->setChromosome(RandomNumberGenerator::nextInt(candidate->getGenome().size()),RandomNumberGenerator::nextFloat(1));
        }
    }
    return candidate;
}
